import http from '@/utils/http';
import {postAjax,request} from '@/utils/axios';



/**
 * 删除区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const removeDataCommon = (params: any) => {
  return http.delete('bus/data/remove', {params});
}

/**
 * 获取系统用户列表
 * @param params
 * @returns {*|Promise<any>}
 */
export const getDataCommonList = (params?: any) => {
  return http.get('bus/data/list', {params});
}

/**
 * 获取系统用户列表
 * @param params
 * @returns {*|Promise<any>}
 */
export const getDataCommonViewList = (params?: any) => {
  return http.get('bus/data/viewList', {params});
}


/**
 * 保存修改区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const updateDataCommon = (params: any) => {
  return http.put('bus/data/edit', params);
}

/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const addDataCommon = (params: any) => {
  return http.post('bus/data/add', params);
}

/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const getViewTimeLine = (params: any) => {
  return http.get('bus/data/viewTimeLine',{params});
}



/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const addFromOnline = (params: any) => {
  return postAjax('bus/data/addFromOnline', params);
}

/**
 * 
 * @param params 预制数据不变
 * @returns 
 */
export const prepareNotChange = (params: any) => {
  return postAjax('bus/data/prepareNotChange', params);
}



/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const getDataCommon = (params: any) => {
  return http.get('bus/data/' + params.id);
}

export const getFormData = (params: any) => {
  return http.get('bus/data/formData/' + params.id);
}

export const toReport = (params: any) => {
  return http.get('bus/data/toReport/' + params.id);
}

export const backReport = (params: any) => {
  return http.get('bus/data/backReport/' + params.id);
}


export const progressStatistic = (params?: any) => {
  return http.get('bus/data/progressStatistic', {params});
}


export const progressStatisticExport = (params?: any) => {
  return http.get('bus/data/progressStatisticExport', {params});
}

export const categoryStatistic = (params?: any) => {
  return http.get('bus/data/categoryStatistic', {params});
}

export const categoryStatisticExport = (params?: any) => {
  return http.get('bus/data/categoryStatisticExport', {params});
}

export const changeApplyAdd = (params?: any) => {
  return request.post('bus/changeApply/add', params);
}
export const changeApplyEdit = (params?: any) => {
  return request.put('bus/changeApply/edit', params);
}
export const changeApplyToBack = (id?: any) => {
  return request.put(`bus/changeApply/toBack/${id}`);
}
export const changeApplyUserList = (workId?: any, status?: any, pageNum?: any, pageSize?: any) => {
  return request.get(`bus/changeApply/userList?workId=${workId}&status=${status}&pageNum=${pageNum}&pageSize=${pageSize}`);
}

export const userApprovalList = (workId?: any, status?: any, pageNum?: any, pageSize?: any) => {
  return request.get(`bus/changeApply/userApprovalList?workId=${workId}&approvalStatus=${status}&pageNum=${pageNum}&pageSize=${pageSize}`);
}

export const userReportList = (workId?: any, status?: any,pageNum?: any,pageSize?:any) => {
  return request.get(`bus/changeApply/userReportList?workId=${workId}&approvalStatus=${status}&pageNum=${pageNum}&pageSize=${pageSize}`);
}
export const changeApplyApproval = (params?: any) => {
  return request.post(`bus/changeApply/toApproval`,params);
}

export const removeChangeApply = (ids?: any) => {
  return request.delete(`bus/changeApply/remove`,{
    data:ids
  });
}
export const changeApplyToReport = (id: any) => {
  return request.post(`bus/changeApply/toReport/${id}`);
}

/**
 * 下载用户导入模板
 * @returns {*|Promise<any>}
 */
export const downloadData = (params?: any) => {
  return request.post('bus/data/exportExcel',params);
}

export const exportParam = (params?: any) => {
  return http.get('bus/data/exportExcelParam',{params});
}

export const removeEvidence = (params?: any) => {
  return request.post('bus/data/removeEvidence',params);
}
export const historyList = (params?: any) => {
  return request.post('bus/data/historyList',params);
}

export const geoJson = (params?: any) => {
  return request.post('bus/data/geoJson',params);
}

export const userGeoJson = (params?: any) => {
  return request.post('bus/data/userGeoJson',params);
}



